package com.antd.auth.fegin;

import com.antd.admin.api.entity.SysUser;
import com.antd.auth.fegin.factory.RemoteUserFallbackFactory;
import com.antd.common.core.util.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

/**
 * TODO
 *
 * @author 子丶沫
 * @version 1.0
 * @date 2020/11/19 10:06
 */
@FeignClient(contextId = "remoteUserService",value = "antd-admin-server",fallbackFactory = RemoteUserFallbackFactory.class)
public interface RemoteUserService {
    /**
     * 通过用户名查询用户 fegin远程调用
     * @param username
     * @return
     */
    @GetMapping("/user/findByUsername/{username}")
    R<SysUser> findByUsername(@PathVariable("username") String username);

    /**
     * 通过手机号码查询
     * @param mobile
     * @return
     */
    @GetMapping("/user/findByMobile/{mobile}")
    R<SysUser> findByMobile(@PathVariable("mobile") String mobile);
}
